﻿#region 文档操作记录
// TblTransaction.cs
// 说明：
// 
// 创建日期：13:42
// 文档作者：饶杰
//  
// 更新日志：
#endregion

using System;
using System.Collections.Generic;

namespace PullSdkHelper.Tables
{
    /// <summary>
    /// 门禁事件记录表
    /// </summary>
    public class TblTransaction
    {
        /// <summary>
        /// 卡号(开门时的卡号)
        /// </summary>
        public int Cardno { get; set; }
        /// <summary>
        /// 开门的人员编号
        /// </summary>
        public int Pin { get; set; }
        /// <summary>
        /// 验证方式
        /// </summary>
        public int Verified { get; set; }

        /// <summary>
        /// 验证方式的描述
        /// </summary>
        public string VerifiedText
        {
            get
            {
                switch (Verified)
                {
                    case 3:
                        return "仅密码";
                    case 4:
                        return "仅卡";
                    case 11:
                        return "卡加密码";
                    case 200:
                    default:
                        return "其他";
                }
            }
        }
        /// <summary>
        /// 门编号
        /// </summary>
        public int DoorID { get; set; }
        /// <summary>
        /// 门禁记录
        /// </summary>
        public short EventType { get; set; }
        /// <summary>
        /// 门禁记录类型的描述
        /// </summary>
        public string EventTypeText
        {
            get
            {
                return DeviceCenter.TryGetEventType(EventType);
            }
        }
        /// <summary>
        /// 进出的状态
        /// </summary>
        public int InOutState { get; set; }

        public string InOutText
        {
            get
            {
                switch (InOutState)
                {
                    case 0:
                        return "入";
                    case 1:
                        return "出";
                    case 2:
                    default:
                        return "";
                }
            }
        }
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Time_second { get; set; }
    }
}